#include"processbar.h"

void download(callback cb)
{
  srand(time(NULL));
  int total =1024*1024*1024;
  int remain=total;
  while(remain){
    int reduce=rand()%(1024*1024);
    remain-=reduce;
    if(remain<0)remain=0;
    double rate=(total-remain)*1.0/total;
    cb(rate);
  }
  printf("\n");
}

int main()
{
  download(process2);
  return 0;
}
